package com.yzjs.localhost.controller.tNeusoftBigDataTesting;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

import com.yzjs.common.enumeration.RequestMethod;
import com.yzjs.localhost.dto.TNeusoftBigDataTestingEntityDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import com.yzjs.common.base.entity.PageInfo;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.yzjs.localhost.entity.tNeusoftBigDataTesting.TNeusoftBigDataTestingEntity;
import com.yzjs.localhost.service.tNeusoftBigDataTesting.TNeusoftBigDataTestingService;


/**
 * 大数据检测
 *
 * @author dingjiahui
 * @email 15623221261@163.com
 * @date 2021-09-13 18:14:31
 */
@Api(tags = "大数据检测")
@RestController
@RequestMapping("tNeusoftBigDataTesting")
public class TNeusoftBigDataTestingController {
    @Autowired
    private TNeusoftBigDataTestingService tNeusoftBigDataTestingService;

    /**
     * 模糊查询
     *
     * @return
     */
    @ApiOperation(value = "模糊查询", httpMethod = RequestMethod.POST)
    @RequestMapping("/list")
    public List<TNeusoftBigDataTestingEntity> list(@RequestBody TNeusoftBigDataTestingEntity tNeusoftBigDataTestingEntity) {
        List<TNeusoftBigDataTestingEntity> tNeusoftBigDataTestings = tNeusoftBigDataTestingService.findList(tNeusoftBigDataTestingEntity);
        return tNeusoftBigDataTestings;
    }

    /**
     * 分页查询
     *
     * @param tNeusoftBigDataTestingEntity
     * @return
     */
    @ApiOperation(value = "分页查询", httpMethod = RequestMethod.POST)
    @RequestMapping("/listPage")
    public PageInfo<TNeusoftBigDataTestingEntity> listPage(@RequestBody TNeusoftBigDataTestingEntity tNeusoftBigDataTestingEntity) {
        List<TNeusoftBigDataTestingEntity> tNeusoftBigDataTestings = tNeusoftBigDataTestingService.findList(tNeusoftBigDataTestingEntity);
        return new PageInfo<>(tNeusoftBigDataTestings,tNeusoftBigDataTestingEntity);
    }

    /**
     * 信息
     */
    @ApiOperation(value = "详情信息", httpMethod = RequestMethod.GET)
    @RequestMapping("/getDetail")
    public TNeusoftBigDataTestingEntityDTO info(@RequestParam(required = true) Integer id) throws Exception {
        TNeusoftBigDataTestingEntity query = new TNeusoftBigDataTestingEntity();
        query.setId(id);
        TNeusoftBigDataTestingEntityDTO dto = tNeusoftBigDataTestingService.getDetail(query);
        return dto;
    }

    /**
     * 保存
     */
    @ApiOperation(value = "保存", httpMethod = RequestMethod.POST)
    @RequestMapping("/save")
    public TNeusoftBigDataTestingEntity save(@RequestBody TNeusoftBigDataTestingEntity tNeusoftBigDataTesting) {
        tNeusoftBigDataTestingService.insert(tNeusoftBigDataTesting);
        return tNeusoftBigDataTesting;
    }

    /**
     * 删除
     */
    @ApiOperation(value = "删除", httpMethod = RequestMethod.DELETE)
    @RequestMapping("/delete")
    public TNeusoftBigDataTestingEntity delete(@RequestParam(required = true) Integer id) {
        TNeusoftBigDataTestingEntity delete = new TNeusoftBigDataTestingEntity();
        delete.setId(id);
        tNeusoftBigDataTestingService.delete(delete);
        return delete;
    }

    /**
     * 处置
     */
    @ApiOperation(value = "处置", httpMethod = RequestMethod.POST)
    @RequestMapping("/deal")
    public TNeusoftBigDataTestingEntity update(@RequestBody TNeusoftBigDataTestingEntity tNeusoftBigDataTestingEntity) throws Exception {
        tNeusoftBigDataTestingService.deal(tNeusoftBigDataTestingEntity);
        return tNeusoftBigDataTestingEntity;
    }


}
